<?php use_helper('Date') ?>
<?php use_helper('LetsManager'); ?>

<h2>Liste des demandes<?php if($keySearch != null){ echo " comportant '".$keySearch."'"; }?></h2>


<form action="<?php echo url_for('@lets_user_asks_list') ?>"
  method="post"><?php echo $searchForm; ?> <input type="submit"
  name="submit" value="Filtrer" class="small blue button" /></form>
<br />

<table style="width: 95%" class="datalist">
  <thead>
    <tr>
      <th width="20%">Adhérent</th>
      <th width="12%">Catégorie</th>
      <th>Demande</th>
      <th width="10%">Expire</th>
      <?php if($canManageAsks): ?>
      <th width="5%">Actions</th>
      <?php endif ?>
    </tr>
  </thead>
  <tbody>
  <?php foreach ($asksPager as $ask): ?>
  <?php include_partial('rowTable', array('ask' => $ask, 'canManageAsks' => $canManageAsks)) ?>
  <?php endforeach ?>
  <?php if (count($asksPager) == 0): ?>
    <tr>
      <td colspan="3">Aucune demande dans cette catégorie</td>
    </tr>
    <?php endif ?>
  </tbody>
</table>
    <?php include_partial('global/pager', array('pager' => $asksPager, 'route' => '@lets_user_asks_list', 'params' => array('category_id' => $category_id))) ?>
<br />
    <?php echo link_to("Toutes les offres et demandes en PDF",'@lets_allAsksOffers_export_pdf',array('popup'=>true,'class'=>'blue button')) ?>
